// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Hit/Q3D_CPPU_Hit.h"
#include "Hit/Q3D_CPPU_HitType.h"
#include "Q3D_CPPU_PropertyPLIBase.h"
#include "Q3D_CPPU_PropertyPLIPro.generated.h"

class UQ3D_CPPU_PropertyPLIPro;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Value_Pro_Reset, UQ3D_CPPU_PropertyPLIPro *, ptr_u_property_pli_pro);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Value_Pro_ReachMin, UQ3D_CPPU_PropertyPLIPro *, ptr_u_property_pli_pro);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Value_Pro_ReachMax, UQ3D_CPPU_PropertyPLIPro *, ptr_u_property_pli_pro);

/**
 * 
 */
UCLASS(Blueprintable, ClassGroup = (Q3D), meta = (Tooltip = "带光环的有限正整数属性类(C++)"))
class Q3D_LIB_API UQ3D_CPPU_PropertyPLIPro : public UQ3D_CPPU_PropertyPLIBase
{
	GENERATED_BODY()

public:
	UQ3D_CPPU_PropertyPLIPro();
	virtual ~UQ3D_CPPU_PropertyPLIPro();

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "加了光环的属性值"))
	int32 Int_ValuePro;

protected:
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "来自伤害型命中的光环"))
	TMap<FName, UQ3D_CPPU_Hit *> Map_Name_To_Ptr_U_HitDamageHalo;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "来自治疗型命中的光环"))
	TMap<FName, UQ3D_CPPU_Hit *> Map_Name_To_Ptr_U_HitRecoverHalo;

protected:
	UFUNCTION(BlueprintPure, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "工具函数：从一组光环型 Hit 中计算加成"))
	void _F_HitHalo_Value_Cal(TMap<FName, UQ3D_CPPU_Hit *> &map_name_to_ptr_u_hit_halo, UPARAM(DisplayName = "int_value") int32 &int_value_out, UPARAM(DisplayName = "string_log") FString &string_log) const;

private:
	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "工具函数：确保 Max >= ValuePro >= Min >= 0，可能会重置 ValuePro"))
	void _F_ValuePro_Reset(UPARAM(DisplayName = "string_log") FString &string_log);

public:
	virtual void Q3D_F_Limit_Set(int32 int_min_in, int32 int_max_in, bool &bool_success, FString &string_log) override;

	virtual void Q3D_F_Max_Set(int32 int_max_in, bool &bool_success, FString &string_log) override;

	virtual void Q3D_F_Max_SetScale(int32 int_max_in, bool &bool_success, FString &string_log) override;

	virtual void Q3D_F_Value_Dec(int32 int_value_dec) override;

	virtual void Q3D_F_Value_Inc(int32 int_value_inc) override;

	virtual void Q3D_F_Value_Set(int32 int_value_in) override;

	virtual void Q3D_F_Value_SetRandom() override;

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "委托函数：设置 Max，确保 Max >= ValuePro >= Value >= Min >= 0"))
	void Q3D_FD_Max_Set_Pro(UQ3D_CPPU_PropertyPLIPro *ptr_u_property_pli_pro);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "委托函数：设置 Max，确保 Max >= ValuePro >= Value >= Min >= 0，并按原有比例修改 Value"))
	void Q3D_FD_Max_SetScale_Pro(UQ3D_CPPU_PropertyPLIPro *ptr_u_property_pli_pro);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "新增一个光环型命中"))
	void Q3D_F_HitHalo_Inc(UQ3D_CPPU_Hit *ptr_u_hit, UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "删除一个光环型命中"))
	void Q3D_F_HitHalo_Dec(FName name_id, EQ3D_CPPE_HitType enum_hit_type, UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "清除一组光环型命中"))
	void Q3D_F_HitHalo_Clear(EQ3D_CPPE_HitType enum_hit_type);

	UFUNCTION(BlueprintPure, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "以 (Min,Max,Value,ValuePro) 的格式输出"))
	void Q3D_F_ToString_Pro(UPARAM(DisplayName = "string_min_max_base_pro") FString &string_min_max_base_pro) const;
	FString Q3D_F_ToString_Pro() const;

public:
	UPROPERTY(BlueprintAssignable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "多播代理：ValuePro 重置"))
	FQ3D_D_Value_Pro_Reset Q3D_ED_ValuePro_Reset;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "多播代理：ValuePro 达到了 Min"))
	FQ3D_D_Value_Pro_ReachMin Q3D_ED_ValuePro_ReachMin;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PropertyPLIPro, meta = (Tooltip = "多播代理：ValuePro 达到了 Max"))
	FQ3D_D_Value_Pro_ReachMax Q3D_ED_ValuePro_ReachMax;
};
